Ext.onReady(function(){

	//================================================================
	// Set ExtJS proterty.
	//================================================================
	Ext.BLANK_IMAGE_URL = m_ContextName + '/common/ext-2.2/resources/images/default/s.gif';
	Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
	Ext.QuickTips.init();
	
	//================================================================
	// Set Layout using Ext Viewport
	//================================================================
	var viewport = new Ext.Viewport({
		layout: 'border',
		items: [
			new Ext.FormPanel({
				region: 'center',
				id: 'id_fpanel_connect',
				labelWidth: 75,
				frame: true,
				title: 'Connection',
				bodyStype: 'padding:5px 5px 0',
				width: 350,
				defaults: {width: 230},
				defaultType: 'textfield',
				items: [{
					id: 'id_txt_ip',
					fieldLabel: '서버 주소',
					value: '127.0.0.1'
				},{
					id: 'id_txt_id',
					fieldLabel: '아이디',
					value: 'test'
				},{
					id: 'id_txt_pw',
					fieldLabel: '비밀번호',
					inputType: 'password',
					value: 'test'
				}],
				buttons: [{
					text: '연결',
					handler: function() {
						var strName = Ext.getCmp('id_txt_ip').getValue();
						opener.top.frameTree.location.href = m_ContextName + '/analysis/analysis700Main.do?type=1&ip=' + strName;
						opener.top.frameContents.location.href = m_ContextName + '/analysis/analysisDefault.do';
						opener.fnEnableBtn(strName);
						
						window.close();
					}
				},{
					text: '취소',
					handler: function() {
						window.close();
					}
				}]
			})
		]
	});
	
	
	//================================================================
	// Action Function
	//================================================================
	function fnNorthBtn1()
	{
		var url = m_ContextName + '/analysis/analysis400Main.do';
		var name = 'win_popup_connect';
		var w = 350;
		var h = 200;
		
		var strPos = "resizable=yes, scrollbars=yes, status=yes, width=" + w + ", height=" + h + ", left=0, top=0";
		var nw_win = window.open(url, name, strPos);
		nw_win.focus();
	}
	
	function fnNorthBtn2()
	{
		var url = m_ContextName + 'analysis/analysis400Main.do?site=' + m_SiteName;
		var name = 'win_popup_search';
		var w = 500;
		var h = 300;
		
		var strPos = "resizable=yes, scrollbars=yes, status=yes, width=" + w + ", height=" + h + ", left=0, top=0";
		var nw_win = window.open(url, name, strPos);
		nw_win.focus();
	}
});

	
	
function fnEnableBtn(strName)
{
	Ext.getCmp('id_menu_search').enable();
	m_SiteName = strName;
}
	
	
	
	
	
	
	
	
	
	
	
	